package com.exception.demo01;

public class Test {
    public static void main(String[] args) {
        int a=1;
        int b=0;
        try{//try 监控区域
            if(b==0){//throw throws
                throw new ArithmeticException();//主动抛出异常
            }

            System.out.println(a/b);
        }catch (ArithmeticException e){//catch 捕获异常
            System.out.println("finally");
        }catch (Error e){
            System.out.println("fially111");
        }
        finally{//处理善后工作
            System.out.println("结束");
        }

        //catch 先小后大
        //finally 可以不要finally
    }


}
// // Ctrl + alt + t